﻿

namespace Mulala.Cavan.Application.MainBoundedContext.SecurityModule
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Mulala.Cavan.Domain.MainBoundedContext.SecurityModule;

    public static class SecurityAppService 
    {
        #region Roles
        public static IList<SysController> GrantedControllers
        {
            get { return Provider.GetGrantedControllers(); }
        }

        public static IList<SysAction> GrantedActions
        {
            get { return Provider.GetGrantedActions(); }
        }

        public static UserAccount UserAccount
        {
            get { return Provider.GetUserAccount(); }
        }

        public static bool IsLogon
        {
            get { return null != UserAccount; }
        }
        #endregion Roles

        #region singelton SecurityProvider
        static readonly SecurityProvider SecurityProvider = new SecurityProvider();

        static SecurityProvider Provider
        {
            get { return SecurityProvider; }
        }
        #endregion singelton SecurityProvider
    }
}
